package com.neolix.watch.util;


import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.widget.TextView;

import com.neolix.watch.R;


public class DialogFactory extends Activity {

    private Dialog dialog;

    public Dialog createRequestDialog(final Context context, String tip) {

        initDialog(context);

        TextView titleText = (TextView) dialog.findViewById(R.id.tvLoad);
        if (tip == null || tip.length() == 0) {
            titleText.setText("正在处理，请稍后...");
        } else {
            titleText.setText(tip);
        }
        dialog.setCanceledOnTouchOutside(false);
        return dialog;
    }

    private void initDialog(Context context) {
        dialog = new Dialog(context, R.style.dialog);
        dialog.setContentView(R.layout.dialog_layout);
    }
}